package com.kingyun.gpsinspection.purificationservice.facade.service.jsm.regionalmaintenance;

import com.alibaba.fastjson.JSONObject;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.Employee;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.RegionalMaintenance;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.Ztree;

import java.util.List;

/**
 * Created by huangxueqian on 2017/4/19/019.
 */
public interface RegionalMaintenanceService {

    /**
     * 查询所有的区域维护信息
     *
     * @return
     * @throws Exception
     */
    List<RegionalMaintenance> selectRegionalMaintenanceList() throws Exception;


    /**
     * @param regionIds
     * @param parentRegionalMaintenanceId 批量添加数据,区域数据
     */
    int insertRegionalMaintenanceList(List<String> regionIds, String parentRegionalMaintenanceId, Employee employee) throws Exception;


    /**
     * 区域维护删除
     * @param regionIds
     * @param employee
     * @return
     * @throws Exception
     */
    int delRegionalMaintenanceList(List<String> regionIds, Employee employee) throws Exception;


    /**
     * @param key 根据模糊之查询区域维护信息
     */
    List<RegionalMaintenance> selectRegionalMaintenanceList(String key) throws Exception;


    /**
     * 查询当前区域，下没有绑定的区域信息
     * @return
     * @throws Exception
     */
    JSONObject selectRegionListJson(RegionalMaintenance regionalMaintenance) throws Exception;

    /**
     * 查询当前区域，绑定的区域信息
     * @return
     * @throws Exception
     */
    JSONObject selectRegionalMaintenanceList(RegionalMaintenance regionalMaintenance) throws Exception;

    /**
     * @param regionalMaintenance 查询当区域 或者 业务体系 或者生产单元下是否存在子区域
     */
    public List<RegionalMaintenance> selectChildRegionalMaintenanceList(RegionalMaintenance regionalMaintenance) throws Exception;

    /**
     * 根据当前数据
     *
     * @param regionalMaintenanceId
     */
    List<Ztree> selectChildRegionalMaintenanceZtree(String regionalMaintenanceId) throws Exception;


    public List<Ztree> regionalMaintenanceToZtree(List<RegionalMaintenance> regionalMaintenances) throws Exception;

}
